<?php

namespace app\index\validate\my;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class Lawyer
 * @package app\index\validate\my
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 * @see \app\index\controller\my\Lawyer
 */
class Lawyer extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'isId',
        'consultingId' => 'integer|egt:0|max:11',
        'subsidy' => 'numeric',
        'settleStatus' => 'integer|max:3',
        'updated' => 'integer|egt:0|max:11',
        'created' => 'integer|egt:0|max:11',
        'page' => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id' => 'id',
        'consultingId' => 'consultingId',
        'subsidy' => 'subsidy',
        'settleStatus' => 'settleStatus',
        'updated' => 'updated',
        'created' => 'created',
        'page' => '分页页数',
        'page_size' => '分页大小',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require' => '缺少:attribute',
        'id.isId' => '请设置正确的:attribute',
        'consultingId.require' => '请输入:attribute',
        'consultingId.integer' => ':attribute应该是整数',
        'consultingId.egt' => ':attribute应该大于等于:rule',
        'consultingId.max' => ':attribute长度不能超过:rule位',
        'subsidy.require' => '请输入:attribute',
        'subsidy.numeric' => ':attribute应该是数字',
        'settleStatus.require' => '请输入:attribute',
        'settleStatus.integer' => ':attribute应该是整数',
        'settleStatus.max' => ':attribute长度不能超过:rule位',
        'updated.require' => '请输入:attribute',
        'updated.integer' => ':attribute应该是整数',
        'updated.egt' => ':attribute应该大于等于:rule',
        'updated.max' => ':attribute长度不能超过:rule位',
        'created.require' => '请输入:attribute',
        'created.integer' => ':attribute应该是整数',
        'created.egt' => ':attribute应该大于等于:rule',
        'created.max' => ':attribute长度不能超过:rule位',
        'page.require' => '请输入:attribute',
        'page.integer' => ':attribute应该是整数',
        'page.egt' => ':attribute应该大于等于:rule',
        'page.max' => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt' => ':attribute应该大于等于:rule',
        'page_size.max' => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index' => ['page', 'page_size'],
        'save' => ['consultingId', 'subsidy', 'settleStatus', 'updated', 'created'],
    ];

}
